/** @format */

interface IParams {
  [params: string]: any
}

const checkParams = (params: IParams, allowEmpty = false): boolean => {
  const keys = Object.keys(params)
  if (keys.length < 1) {
    return allowEmpty
  }
  const datas = keys.filter(v => params[v] === undefined)
  return !(datas.length > 0)
}

export const findPass = (query: Record<string, any>, projection: Record<string, any>, force: boolean): boolean => {
  if (force) return true

  const _query = checkParams(query)
  const _projection = checkParams(projection, true)

  return true
}
